Exists
|example = }} Notes *When using the Exists condition function, you should NOT change the function parameter, it should be left as TARGET. Death dialogue An example of death dialogue is having the dying actor scream and a nearby group member commenting on their death. Here's how to set up a simple case of that: # Create a new topic that will be used for the response # In the Death topic, add a topic info for the scream and have a Link To the new response topic you created # In the new response topic, add a topic info for the comment( i.e. "Man down!", "Oh my God they killed him!", etc. ). #* Set the Link From on the new topic info to be the Death topic #* Add a condition to the topic info that calls the Exists condition function and checks if the return value is 1. This condition item should be set up to run on self, NOT on the target. The total effect of these changes is that the dying NPC will say a scream, then look for a response in the new topic. It will find the new topic info for the comment and check the Exists condition function. If there is a group member available to comment, Exists will return 1 and the comment will be made. If there is no group member available, Exists will return 0 and the comment will not be said. By setting it up in this fashion, the scream will be said both when there is and when there isn't another group member around. Giving commands Setting up actors to give commands is similar to setting up the Death Dialogue. For example, the FireExplosive topic is used before an NPC fires an explosive weapon. This can be used to say things like "Fire in the hole!" before throwing a grenade. The same topic can be used to have another NPC say "Throw your grenade soldier!". Here's how to set up both cases: # Create a new topic that will be used for the response # In the FireExplosive topic, add a topic info with no text and no sound. In the future, we may add a checkbox that explicitly says that it is a blank topic info. #* Set the Link To on the blank topic info to be the response topic #* Add a condition to the blank topic that runs on the target and calls the Exist condition function and checks if it is 1. # In the FireExplosive topic, add another topic info lower on the stack and set the text to "Fire in the hole!" # In the response topic you created before, add a new topic info for the response. #* Set the text on the response topic info to be "Throw your grenade soldier!" #* Set the Link From to the FireExplosive topic The total effect of these changes is that when an NPC goes to throw a grenade, the FireExplosive topic will be triggered. If there is another group member nearby, the Exists condition function will return true and the blank topic info will be chosen to start the conversation. The "Throw your grenade soldier!" topic info will be chosen as the response to that, so in game it will appear that the nearby group member is giving an order to the NPC that started the conversation. If there is not another group member nearby, the Exists condition function will return 0 so the blank topic will not be chosen. The next topic info in the stack is the "Fire in the hole!" topic info, so that is what will be said. Категория:Функции Категория:Condition Functions Категория:Condition Functions (GECK 1.1)